package com.ljq.controller;

import com.ljq.producers.KafkaProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * kafak-test控制器
 *
 * @author liujiaqi
 * @date 2023/02/14
 */
@RestController
public class KafakController {

    @Autowired
    private KafkaProducer kafkaProducer;

    @GetMapping("/testKafka")
    public  String testKafka(@RequestParam("send") String send){
        kafkaProducer.send(send);
        return "ok";
    }
}
